package com.subfg.api.constant;

public enum UriDesciptionEnum {
    // 初始化
    INIT_URIDESCIPTION("未知的, 错误的", "unkown"),
    API_USER_SENDVERIFY("发送验证码", "/api/v2/user/sendVeifyCode"),
    API_USER_LOGIN("用户登录", "/api/v2/user/login"),
    API_USER_SIGNUP("用户注册", "/api/v2/user/signup"),
    API_USER_AUTHLOGIN("三方登录", "/api/v2/user/authLogin"),


    API_USER_BINDAUTHACCOUNT("用户绑定三方账号", "/api/v2/user/bindAuthAccount"),
    API_USER_SETTINGUPLOAD("用户通用设置", "/api/v2/user/settingUpload"),
    API_USER_UNBINDAUTHACCOUNT("用户解绑三方账号", "/api/v2/user/unbindAuthAccount"),
    API_USER_UNSUBSCRIBEACCOUNT("用户注销", "/api/v2/user/unsubscribeAccount"),
    API_USER_UPDATEUSERINFO("修改个人信息", "/api/v2/user/updateUserInfo"),
    API_USER_USERLOGIN("用户退出登录", "/api/v2/user/userLogout"),
    API_USER_GETUPLOAD("oss签名", "/api/v2/user/getUploadSignature"),
    API_USER_FORVIFYCODE("[无token] 忘记密码时, 验证码是否有效", "/api/v2/user/forgetVerifyCode"),
    API_USER_FORGETUPDATEPWD("[无token] 忘记修改, 修改密码", "/api/v2/user/forgetUpdatePwd"),
    API_USER_USERUPDATE("用户修改密码时, 验证验证码", "/api/v2/user/userUpdatePwd"),
    API_USER_SETTINGTRANSACTIONPWD("用户设置交易密码", "/api/v2/user/settingTransactionPwd"),
    API_USER_FORGETTRACATIONPWD("用户忘记交易密码. 重新设置交易密码", "/api/v2/user/forgetTransactionPwd"),
    API_USER_VERIFYPAYPWD("验证交易密码", "/api/v2/user/verifyPayPwd"),
    API_USER_AUTHREGISTER("[无token] 三方登录 直接进行注册", "/api/v2/user/authLoginRegister"),
    API_USER_AUTHLOGINBIND("[无token] 三方登录 进行绑定 其他账号", "/api/v2/user/authLoginBind"),
    API_USER_GETUSERPROFILES("获取用户详细信息", "/api/v2/user/getUserProfiles"),

    API_FG_HOMEFAMILY("首页家庭组", "/api/v2/fg/homeFamilyGroup"),
    API_FG_CREATEFAMILY("创建家庭组", "/api/v2/fg/createFamilyGroup"),
    API_FG_UPDATEFAMILY("修改家庭组", "/api/v2/subm/updateFamilyGroup"),
    API_FG_FINDKEYFAMILYGOUP("根据家庭组查询家庭组信息", "/api/v2/fg/findKeyFamilyGroupInfo"),
    API_USER_FGMEMBERLIST("[无token]用户查看在使用该家庭组服务的成员", "/api/v2/fg/useFgMemberList"),

    API_FG_TOMYCOLLECT("添加家庭組到我的收藏", "/api/v2/fg/addToMyCollect"),
    API_FG_MYCOLLECTLIST("用户收藏列表", "/api/v2/fg/myCollectList"),
    API_FG_REMOVEMYCOLLECT("移除收藏", "/api/v2/fg/removeMyCollect"),

    API_COMMON_INIT("初始化", "/api/v2/common/init"),
    API_COMMON_MEMBERLIST("家庭组相关订单信息", "/api/v2/common/memberOrderList"),
    API_COMMON_CATEGORY("筛选种类下的产品", "/api/v2/common/productFromCategory"),
    API_COMMON_SEARCH("筛选", "/api/v2/common/searchInfo"),
    API_COMMON_POPULARPRODUCT("首页流行产品", "/api/v2/home/popularProduct"),
    API_COMMON_FILLTERFAMILYGROUP("筛选家庭组, 可用于 根据 多地区, 多套餐,  多产品", "/api/v2/common/fillterFamilyGroup"),
    API_COMMON_FILLTERPRODUCT("筛选产品", "/api/v2/common/fillterProduct"),
    API_COMMONT_FILLTERPRODUCTPLAN("产品套餐列表", "/api/v2/common/productPlanList"),
    API_COMMONT_CURRENTLIST("所有货币汇率","/api/v2/common/currentList"),
    API_COMMON_REGION("所有国家地区", "/api/v2/common/regionList"),

    API_COMMON_PAYVERIYF("验证支付是否成功", "/api/v2/common/payVerify"),
    API_COMMON_MERGEORDERLIST("合单订单号列表", "/api/v2/common/mergeOrderList"),

    API_MESSAGE_COMMENTFG("评论家庭组", "/api/v2/message/commentFg"),
    API_MESSAGE_COMMENTREPLY("回复评论", "/api/v2/message/commentReply"),
    API_MESSAGE_COMMENTFGLIST("评论家庭组的评论列表", "/api/v2/message/commentFgList"),
    API_MESSAGE_COMMENTReplyLIST("查看此评论有多少回复", "/api/v2/message/commentReplyList"),
    API_MESSAGE_GETUSERMESSAGELIST("获取用户消息数据", "/api/v2/message/getUserMessageList"),
    API_MESSAGE_UPDATEMESSAGEREADSTATUS("将消息设为已读状态", "/api/v2/message/updateMessageReadedStatus"),
    API_MESSAGE_GETUNREADMESSAGESTATUS("获取用户未读消息", "/api/v2/message/getUnreadMessageStatus"),

    API_TARSACTION_CLOSEFG("取消家庭组共享计划", "/api/v2/transaction/closeFG"),
    API_TARSACTION_CLOSEPAYMENT("取消支付", "/api/v2/transaction/closePayment"),
    API_TARSACTION_COMFIRMFG("家庭组收到邀请连接", "/api/v2/transaction/comfirmFamilyGroup"),
    API_TARSACTION_SENDINIVTE("发送邀请方式", "/api/v2/transaction/sendInivte"),
    API_TARSACTION_CLOSEORDER("关闭支付订单", "/api/v2/transaction/creatOrderInfo"),
    API_TARSACTION_CREATEPAYMENT("生成支付信息", "/api/v2/transaction/createPaymentInfo"),
    API_TARSACTION_EXITFG("退出家庭组", "/api/v2/transaction/exitFG"),
    API_TARSACTION_KICKMEMBER("移除成员", "/api/v2/transaction/kickMemberFG"),
    API_TARSACTION_MERGEORDER("合并订单", "/api/v2/transaction/mergeOrderPayment"),
    API_TARSACTION_WITHDRAW("提现金额", "/api/v2/transaction/withdraw"),
    API_TARSCATION_FINDUNPAID("家庭组id查询未支付的订单", "/api/v2/transaction/findFgUnpaid"),
    API_TARSACTION_UPDATETHRIDORDER("待支付订单(仅待支付订单有效), 修改订单三方账号信息", "/api/v2/transaction/updateThirdAccountUnpaidOrder"),
    API_TARSACTION_UNPAIDPAYINFO("待支付订单, 支付页面数据显示", "/api/v2/transaction/unpaidPayInfo"),

    API_SUBM_CUSTOMSUBM("添加自定义家庭组订阅", "/api/v2/subm/createCustomSubm"),
    API_SUBM_UPDATECUSOM("修改自定义家庭组", "/api/v2/subm/getCustomSubmList"),
    API_SUBM_GETSUBMINFO("根据id, 获取自定义订阅信息", "/api/v2/subm/getCustomFgInfo"),
    API_SUBM_MYCREATEFG("订阅模块列表展示, type[1: SUM 2: GUEST 3: HOST]", "/api/v2/subm/getSubList"),
    API_SUBM_MYMEMBERLIST("我的座位号列表", "/api/v2/subm/myMemberList"),
    API_SUBM_GETSUBMEMBERLIST("订阅家庭组成员列表", "/api/v2/subm/getSubMemberList"),
    API_SUBM_GETSUBMEMORDERLSIT("根据座位号, 查询出订单列表", "/api/v2/subm/getMemberOrderList"),
    API_SUBM_GETMEMBERIDINFO("车友自己的订阅详情", "/api/v2/subm/getMemberIdInfo"),

    API_BILLING_BILLING("用户流水信息", "/api/v2/billing/withdrawList"),
    API_BILLING_ORDERINFO("订单详细信息", "/api/v2/billing/getOrderInfo"),
    API_BILLING_MYORDERLIST("用户自己的订单列表[全部状态]", "/api/v2/billing/getUserOrderList"),
    API_BILLING_GETUNPAIDLIST("待支付订单列表", "/api/v2/billing/getUnpaidOrderList"),

    /** 回调 **/
    API_CALL_PAYMENTSUCCESS("支付宝支付成功后回调地址", "/callBack/paymentSuccess"),
    API_CALL_STRIPENOTIFY("stripe 支付成功回调", "/callBack/stripeNotify"),
    API_CALL_OSSNOTIFY("oss对象 验证 上传图片是否合法", "/callBack/ossNotify")
    ;

    private String message;
    private String apiName;


    public String getApiName(){
        return this.apiName;
    }
    public String getMessage(){
        return this.message;
    }

    UriDesciptionEnum(String message, String apiName) {
        this.message = message;
        this.apiName = apiName;
    }

    /**
     * 请求时的uri信息 是否存在本系统
     * @param uri   请求时的uri
     * @return
     */
    public static UriDesciptionEnum fromCode(String uri) throws BusinessException {
        if(uri != null){
            for(UriDesciptionEnum uriDesciptionEnum : values()){
                if(uri.equals(uriDesciptionEnum.getApiName())){
                    return uriDesciptionEnum;
                }
            }
        }
        throw new BusinessException(ConstantEnum.NOT_SUPPORT_API);
    }
}
